package com.jy.api.vo.stock;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by lihu on 2018/1/31.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HomePageVo {

    private int totalPages;


    private long totalElements;


    private List<ProductVo> products = new LinkedList<>();


    public HomePageVo(int totalPages, long totalElements) {
        this.totalPages = totalPages;
        this.totalElements = totalElements;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ProductVo {


        private String id;

        private String name;

        private String typeName;

        /**
         * 规格
         */
        private int stockQuantityRatio;

        /**
         * 每件价格
         */
        private int stockPrice = 0;


        /**
         * 柜台商品数量（单位个）
         */
        private int counterQuantity = 0;

        /**
         * 仓库商品数量（单位个）
         */
        private int warehouseQuantity = 0;


        public ProductVo(String id, String name, String typeName, int stockQuantityRatio,
                         int stockPrice, int counterQuantity) {
            this.id = id;
            this.name = name;
            this.typeName = typeName;
            this.stockQuantityRatio = stockQuantityRatio;
            this.stockPrice = stockPrice;
            this.counterQuantity = counterQuantity;
        }
    }
}
